fn main() {
    let mut width = 10;
    let mut height = 5;
    println!("the rect({},{}) area is:{}",width,height,width * height);

    println!("the rect({},{}) area is:{}",width,height,caculate_rect_area(width,height));

    width = 50;
    height = 30;
    let rect = (width,height);
    println!("the rect({},{}) area is:{}",width,height,caculate_rect_area_tuple(rect));

    let rect = Rect {
        width : 100,
        height : 100
    };
    println!("the rect area is:{}",caculate_rect_area_struct(rect));
}

fn caculate_rect_area(width : u32, height : u32) -> u32 {
    width * height
}

fn caculate_rect_area_tuple(rect : (u32,u32)) -> u32 {
    rect.0 * rect.1
}

struct Rect{
    width : u32,
    height : u32
}

fn caculate_rect_area_struct(rect : Rect) -> u32 {
    rect.width * rect.height
}